package Object.net.tjdz.model;  // 保持与Person相同的包

public class Teacher extends Person {
    private String department;

    public Teacher(String id, String name, int age, String department) {
        super(id, name, age);  // 调用父类构造方法
        this.department = department;
    }

    // 实现父类抽象方法（修正方法名大小写）
    @Override
    public String getdetail() {
        return String.format("教师详情：工号=%s, 姓名=%s, 年龄=%d, 部门=%s",
                getId(), getName(), getAge(), department);
    }

    // 修正toString()方法
    @Override
    public String toString() {
        return super.toString() + ", 部门：" + department;
    }

    public String getDepartment() {
        return department;
    }

    public void setDepartment(String department) {
        this.department = department;
    }
}